<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    {:token()}
    <div class="form-group">
        <label for="c-money" class="control-label col-xs-12 col-sm-2"><span style="color: red;font-size: 15px">*</span>{:__('退款金额')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-money" class="form-control" data-rule="required" name="row[money]" type="text" value="">
        </div>
    </div>


    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
<!--            <button id="news" type="submit" class="btn btn-success btn-embossed">{:__('退款')}</button>-->
            <button id="news" type="submit" class="btn btn-success" formnovalidate="">退款</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<script src="/assets/img/jquery-3.4.1.min.js"></script>
<script>
    $('#news').click(function(){
        let money = $("#c-money").val();
        let id = {$row};
        $.ajax({
            url:"financing/accepts/edit_ss",//请求的url地址
            dataType:"json",//返回格式为json
            async:true,//请求是否异步，默认为异步，这也是ajax重要特性
            data:{"id":id,"money":money,},//参数值
            type:"POST",//请求方式
            success:function(data){
                //请求成功时处理
                if (data.code == 0) {
                    //console.log(data);
                    Toastr.error(data.msg);
                }else {
                    parent.Toastr.success(data.msg);
                    parent.$(".btn-refresh").trigger("click");
                    parent.Layer.closeAll();
                }
            },
            error:function (data){
                Toastr.error(data);
            },
        });
    })


</script>
